<?php

include_once '../../../lib/import.php';

$window = new WBResizableWindow(array(
	'title' => 'Message Test',
	'height' => 300,
	'width' => 300,
	'x' => 'center',
	'y' => 'center',
	'layout' => array('layout' => 'grid', 'columns' => 4, 'rows' => 4)
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'info',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'warning',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'okcancel',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'question',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'stop',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'yesno',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'yesnocancel',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'color',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'open',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'path',
	'event' => array('click' => 'test')
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => 'save',
	'event' => array('click' => 'test')
));

$window->visible = true;

wbstart();

function test($eo) { 
	if ($eo->object()->text == 'info') { 
		WBDialog::info($eo->window(), "this is info message", 'info');
	} else if ($eo->object()->text == 'warning') { 
		WBDialog::warning($eo->window(), "this is warning message", 'warning');
	} else if ($eo->object()->text == 'okcancel') { 
		$ret = WBDialog::okcancel($eo->window(), "this is okcancel message", 'okcancel');
		
		WBDialog::info($eo->window(), $ret, "return value");
	} else if ($eo->object()->text == 'question') { 
		WBDialog::question($eo->window(), "this is question message", 'question');
	} else if ($eo->object()->text == 'stop') { 
		WBDialog::stop($eo->window(), "this is stop message", 'stop');
	} else if ($eo->object()->text == 'yesno') { 
		$ret = WBDialog::yesno($eo->window(), "this is yesno message", 'yesno');
		
		WBDialog::info($eo->window(), $ret, 'yesno');
	} else if ($eo->object()->text == 'yesnocancel') { 
		$ret = WBDialog::yesnocancel($eo->window(), "this is yesnocancel message", 'yesnocancel');
		
		WBDialog::info($eo->window(), $ret, 'yesnocancel');
	} else if ($eo->object()->text == 'color') { 
		$ret = WBDialog::color($eo->window(), "this is color ", YELLOW);
		
		WBDialog::info($eo->window(), sprintf("%X", $ret), 'color');
	} else if ($eo->object()->text == 'open') { 
		$ret = WBDialog::open($eo->window(), "this is open dialog ");
		
		WBDialog::info($eo->window(), $ret, 'open');
	} else if ($eo->object()->text == 'path') { 
		$ret = WBDialog::path($eo->window(), "this is path dialog ");
		
		WBDialog::info($eo->window(), $ret, 'path');
	} else if ($eo->object()->text == 'save') { 
		$ret = WBDialog::save($eo->window(), "this is save dialog ");
		
		WBDialog::info($eo->window(), $ret, 'save');
	}
	
	
}


?>